home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 113_01 / a15.doc < prev    next >
Text File  |  1985-03-09  |  30KB  |  851 lines

  1. /*
  2.     HEADER:        CUG113;
  3.     TITLE:        1802 Cross-Assembler (BDS C Version);
  4.     FILENAME:    A15.DOC;
  5.     VERSION:    1.2;
  6.     DATE:        07/22/1985;
  7.  
  8.     DESCRIPTION:    "This program lets you use your CP/M-80-based computer
  9.             to assemble code for the RCA 1802, 1804, 1805, 1805A,
  10.             1806, AND 1806A microprocessors.  The program is
  11.             written in BDS C for the best possible performance on
  12.             8-bit machines.  All assembler features are supported
  13.             except relocation, linkage, listing control, and
  14.             macros.";
  15.  
  16.     KEYWORDS:    Software Development, Assemblers, Cross-Assemblers,
  17.             RCA, CDP1802, CDP1805A;
  18.  
  19.     SEE-ALSO:    CUG149, 1805A Cross-Assembler (Portable);
  20.  
  21.     SYSTEM:        CP/M-80;
  22.     COMPILERS:    BDS C;
  23.  
  24.     WARNINGS:    "This package is specifically tailored to CP/M-80
  25.             machines and the rather non-standard, but high-
  26.             performance BDS C compiler.  For other environments,
  27.             use the portable version of this package on CUG149.";
  28.  
  29.     AUTHORS:    William C. Colley III;
  30. */
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.                      1805A/1802 Cross-assembler
  42.  
  43.  
  44.                              Version 1.2
  45.  
  46.  
  47.          Copyright (c) 1980, 82, 83, 85 William C. Colley III
  48.  
  49.  
  50.  
  51.                       The Manual Such As It Is.
  52.  
  53. 1805A Cross-assembler User Manual                              Page  1
  54.  
  55.  
  56. Table of Contents
  57.  
  58. 1.0       Format of Cross-assembler Commands........................ 2
  59.  
  60.      1.1  Command Strings........................................... 2
  61.      1.2  Options................................................... 2
  62.      1.3  Examples.................................................. 2
  63.  
  64. 2.0       Format of Cross-assembler Source Files.................... 4
  65.  
  66.      2.1  Statements................................................ 4
  67.      2.2  Symbols................................................... 5
  68.      2.3  Numeric Constants......................................... 5
  69.      2.4  Strings................................................... 6
  70.  
  71. 3.0       Expression Evaluation..................................... 7
  72.  
  73. 4.0       1805A Instructions........................................ 8
  74.  
  75.      4.1  No Argument Group......................................... 8
  76.      4.2  Register Group............................................ 8
  77.      4.3  8-bit Immediate Group..................................... 8
  78.      4.4  Short Branch Group........................................ 9
  79.      4.5  Long Branch Group......................................... 9
  80.      4.6  Input/Output Group........................................ 9
  81.      4.7  2-Argument Group.......................................... 9
  82.  
  83. 5.0       Pseudo-operations.........................................10
  84.  
  85.      5.1  BLK.......................................................10
  86.      5.2  BYTE......................................................10
  87.      5.3  Conditional Assembly......................................10
  88.      5.4  CPU.......................................................11
  89.      5.5  END.......................................................11
  90.      5.6  EQU.......................................................12
  91.      5.7  LOAD......................................................12
  92.      5.8  ORG.......................................................12
  93.      5.9  PAGE......................................................13
  94.      5.10 SET.......................................................13
  95.      5.11 TEXT......................................................13
  96.      5.12 WORD......................................................13
  97.  
  98. 6.0  Error Messages.................................................14
  99.  
  100. 7.0  Assembler Abort Conditions.....................................16
  101.  
  102. 8.0  Compiling the Assembler........................................17
  103.  
  104. 9.0  Final Comments.................................................18
  105.  
  106. 1805A Cross-assembler User Manual                              Page  2
  107.  
  108.  
  109. 1.0  Format of Cross-assembler Commands
  110.  
  111. 1.1  Command Strings
  112.  
  113.      To run the 1805A cross-assembler, type the following command
  114. line:
  115.  
  116.           A>a15 filename options
  117.  
  118.           filename: The name of the source input file is filename.rca,
  119.                     the list can go to filename.prn, and the hex file
  120.                     can go to filename.hex.  If any type is appended
  121.                     to the filename, it is ignored.
  122.  
  123.           options:  See next section.
  124.  
  125.  
  126. 1.2  Options
  127.  
  128.      The source file comes from the currently logged disk drive unless
  129.      it is redirected by putting the string "sd" in the options field.
  130.      "s" specifies the source file and "d" is a device code from the
  131.      following list:
  132.  
  133.           a, b, c, d     disk drives
  134.           -              the currently logged-in disk drive
  135.  
  136.      Lines of input containing errors will always be output to the
  137.      console device.  If the full listing is desired, it must be
  138.      called for by putting the string "ld" in the options field.  "l"
  139.      specifies the list file and "d" is a device code as per the
  140.      source file or one of the following:
  141.  
  142.           x              console device
  143.           y              list device
  144.  
  145.      The hex file will not be output unless called for with the string
  146.      "hd" with device codes as per the list file.
  147.  
  148.      Options must be run together into a single string with no
  149.      embedded blanks.
  150.  
  151.  
  152. 1.3  Examples
  153.  
  154.      A>a15 barf               source -- a:barf.rca
  155.                               list   -- none
  156.                               hex    -- none
  157.  
  158.      A>a15 barf sblxha        source -- b:barf.rca
  159.                               list   -- con:
  160.                               hex    -- a:barf.hex
  161.  
  162. 1805A Cross-assembler User Manual                              Page  3
  163.  
  164.  
  165.      A>a15 barf ly            source -- a:barf.rca
  166.                               list   -- lst:
  167.                               hex    -- none
  168.  
  169.      A>b:a15 barf sbh-        source -- b:barf.rca
  170.                               list   -- none
  171.                               hex    -- a:barf.hex
  172.  
  173.      B>a:a15 barf h-          source -- b:barf.rca
  174.                               list   -- none
  175.                               hex    -- b:barf.rca
  176.  
  177. 1805A Cross-assembler User Manual                              Page  4
  178.  
  179.  
  180. 2.0  Format of Cross-assembler Source Files
  181.  
  182.      Lines of source input are terminated with CR/LF pairs.
  183.      Internally, the character before the LF is discarded, so if the
  184.      CR is missing, the last character of the line will be eaten up.
  185.      The internal line buffer will hold a 120-character line.  This
  186.      may be changed by altering the "#define LINLEN 120" statement in
  187.      a15.h and recompiling the cross-assembler.  Excess characters in
  188.      the line are thrown out.
  189.  
  190.      Lower case letters are converted to upper case in as few places
  191.      as possible.  They are:
  192.  
  193.           1)  In opcodes,
  194.  
  195.           2)  In checking for keywords such as NOT, and
  196.  
  197.           3)  In command strings.
  198.  
  199.      This means that "not", "NOT", "Not", etc. are all possible
  200.      spellings of the logical inversion operator.  This also means
  201.      that "foo" and "FOO" are different symbols.  Watch this if you
  202.      start encountering U errors of symbols that you "know" you
  203.      defined.
  204.  
  205.  
  206. 2.1  Statements
  207.  
  208.      Source files input to the cross-assembler consist of statements
  209.      of the form:
  210.  
  211.           [label]   [opcode   [arguments]]   [;comments]
  212.  
  213.      Labels are recognized by their beginning in column 1.  If it
  214.      doesn't begin there, it is assumed to be an opcode.  Labels are
  215.      assigned the current program counter value unless the line's
  216.      opcode is "EQU" or "SET".
  217.  
  218.      Opcodes may be either 1805A machine instruction mnemonics or
  219.      pseudo-ops (i.e. assembler directives).
  220.  
  221.      The arguments following the opcode will vary with the opcode. In
  222.      the case of opcodes such as "NOP", they may be absent entirely.
  223.  
  224.      Lines terminate with either a CR/LF pair or a semicolon that is
  225.      not embedded in a quoted string.  Anything after a semicolon is
  226.      ignored by the assembler, but will appear in the listing.  Note
  227.      that a semico